#ifndef CVSESSION_H
#define CVSESSION_H

#include <QObject>
#include <QList>
#include <QtNetwork/QNetworkCookie>
#include "model/cvnetwork.h"
#include "model/cvuser.h"

class CVSession : public QObject
{
    Q_OBJECT
public:
    virtual ~CVSession();
    static CVSession *get();
    
    void setCurrentNetwork(CVNetwork *network);
    void setUser(CVUser *user);
    void setUserId(const QString &userId);
    void setPassword(const QString &password);
    void setSessionId(const QString &sessionId);
    void setCookies(QList<QNetworkCookie> cookies);

    CVNetwork *getCurrentNetwork();
    CVUser *getUser();
    QString getUserId();
    QString getPassword();
    QString getSessionId();
    QList<QNetworkCookie> getCookies();
signals:
    
public slots:
    void clear();
private:
    CVSession();

    static CVSession *instance;

    CVNetwork *network;
    CVUser *user;
    QString userId;
    QString password;
    QString sessionId;
    QList<QNetworkCookie> cookies;
};

#endif // CVSESSION_H
